﻿using System;

namespace TextEditor
{
   

    public class A_DesignMode : A_Action
    {
        public override string ActionName()
        {
            return "designmode";
        }

        public override int CheckState()
        {
            return (base.myOwnerDocument.Info.DesignMode ? 1 : 0);
        }

        public override bool Execute()
        {
            base.myOwnerDocument.Info.DesignMode = !base.myOwnerDocument.Info.DesignMode;
            base.myOwnerDocument.RefreshElements();
            base.myOwnerDocument.RefreshLine();
            base.myOwnerDocument.UpdateView();
            return true;
        }

        public override bool isEnable()
        {
            return true;
        }
    }
}

